package ioc

import (
	"gitee.com/DonHz/basic-go/webook/internal/service/oauth2/wechat"
	"gitee.com/DonHz/basic-go/webook/internal/web"
	"gitee.com/DonHz/basic-go/webook/pkg/logger"
	"net/http"
)

func InitWechatService(l logger.Logger) wechat.Service{
	//appId, ok:=os.LookupEnv("WECHAT_APP_ID")
	//if !ok {
	//	panic(any("没有找到环境变量 WECHAT_APP_ID "))
	//}
	//appId:="wx516d7a115893589e"
	//appSecret:="daf711f4692cfe7baf7209f15347289"
	appId:="wx7256bc69ab349c72"
	appSecret:="6f7fc3956d66f9deff26923eea4eba82"
	//appSecret, ok:=os.LookupEnv("WECHAT_APP_SECRET")
	//if !ok {
	//	panic(any("没有找到环境变量 WECHAT_APP_SECRET "))
	//}
	return wechat.NewAuthUrlService(appId,appSecret, http.DefaultClient, l)
}

func NewWechatHandlerConfig() web.WechatHandlerConfig {
	return web.WechatHandlerConfig{
		Secure: false,
	}
}